**************************************************************************************************
*** This do file creates the replication results for 
*** "Why Do States Contribute to the Global Refugee Governance? 	                            
***    Fiscal Burden-Sharing in the Post-2011 Syrian Refugee Crisis"
*** Published in: International Interactions, 2022

*** Hirotaka Fujibayashi (Graduate Institute of International and Develpment Studies, Geneva)																
***	Please report any errors to hirotaka.fujibayashi@graduateinstitute.ch																	
**************************************************************************************************

* All statistical analyses were conducted using Stata/IC version 15.1 
version 15.1
set more off

* Set overall background of plots to white 
grstyle init
grstyle color background white
/* Note: Run `grstyle init` to (re)start the default/custom setting */

* Import data and declare the data to be treated as panel data 
use Fujibayashi_II2022_data, clear
xtset country year

**************************************************************************************************
/* Main Analysis                                                                                */
**************************************************************************************************


*** Figure 1 ***

/* 2012 */	  
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500 & year==2012, /// 
   mlabel(ccode) mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) title("2012", size(medium)) ///
   xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500 & year==2012, mlabel(ccode) mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))  
/* graph save as "sc2012.gph" */

/* 2013 */
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500 & year==2013, ///
   mlabel(ccode) mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) title("2013", size(medium)) ///
   xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500 & year==2013, mlabel(ccode) mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))
/* graph save as "sc2013.gph" */
   
/* 2014 */
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500 & year==2014, ///
   mlabel(ccode) mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) title("2014", size(medium)) ///
   xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500 & year==2014, mlabel(ccode) mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))
/* graph save as "sc2014.gph" */
   
/* 2015 */
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500 & year==2015, ///
   mlabel(ccode) mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) title("2015", size(medium)) ///
   xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500 & year==2015, mlabel(ccode) mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))
/* graph save as "sc2015.gph" */

/* 2016 */
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500 & year==2016, ///
   mlabel(ccode) mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) title("2016", size(medium)) ///
   xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500 & year==2016, mlabel(ccode) mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))
/* graph save as "sc2016.gph" */

/* 2017 */
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500 & year==2017, ///
   mlabel(ccode) mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) title("2017", size(medium)) ///
   xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500 & year==2017, mlabel(ccode) mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))
/* graph save as "sc2017.gph" */   
 
/* 2018 */
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500 & year==2018, ///
   mlabel(ccode) mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) title("2018", size(medium)) ///
   xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500 & year==2018, mlabel(ccode) mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))
/* graph save as "sc2018.gph" */

/* 2019 */
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500 & year==2019, ///
   mlabel(ccode) mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) title("2019", size(medium)) ///
   xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500 & year==2019, mlabel(ccode) mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))
/* graph save as "sc2019.gph" */

/* 2020 */
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500 & year==2020, ///
   mlabel(ccode) mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) title("2020", size(medium)) ///
   xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500 & year==2020, mlabel(ccode) mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))
/* graph save as "sc2020.gph" */
  
/* Pooled */
graph twoway (scatter ln_syria_aid L1.ln_syrian_ref if distance>2500, mcolor(dknavy) msymbol(d) jitter(#) mlabcolor(dknavy) xlabel(, labsize(small)) ylabel(, labsize(small)) ///
   title("Pooled observations", size(medium)) xtitle("ln(Syrian Ref)", size(small)) ytitle("ln(Syria Aid)", size(small)) legend(order(1 "Dist > 2,500km" 2 "Dist ≤ 2,500km") size(small))) ///
   (scatter ln_syria_aid L1.ln_syrian_ref if distance<=2500, mcolor(gs9) msymbol(sh) jitter(#) mlabcolor(gs9))
/* graph save as "scPool.gph" */

* Compile all scatter plots into a single panel	  
graph combine sc2012.gph sc2013.gph sc2014.gph sc2015.gph sc2016.gph sc2017.gph sc2018.gph sc2019.gph sc2020.gph scPool.gph, rows(3) xcommon ycommon iscale(.5) 


*** Table 1 (Two-part model, RE) ***

/* 1st stage */
* Model 1
xtprobit contribute L1.ln_syrian_ref ln_distance ib(2012).year, re vce(cluster country)
* Model 2
xtprobit contribute c.L1.ln_syrian_ref##c.ln_distance ib(2012).year, re vce(cluster country)
* Model 3
xtprobit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom ib(2012).year, vce(cluster country)

/* 2nd stage */
* Model 4
xtreg ln_syria_aid L1.ln_syrian_ref ln_distance ib(2012).year if contribute==1, re vce(cluster country)
* Model 5
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance ib(2012).year if contribute==1, re vce(cluster country)
* Model 6
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)


*** Figure 2 ***

* Recall a probit regression result (Model 3 in Table 1)
xtprobit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom ib(2012).year, vce(cluster country)
* Estimate and plot average marginal effects
margins, dydx(L1.ln_syrian_ref) at(ln_distance=(5(0.5)10)) vsquish 
marginsplot, yline(0, lpattern(shortdash)) recast(line) recastci(rline) plotopt(lcolor(dknavy)) ciopt(color(gs9) lpattern(dash)) ///
   xlabel(, labsize(small)) ylabel(, labsize(small)) title("AME of logged number of Syrian refugees per 10,000 population (with 95% CIs)", size(medsmall)) ///
   xtitle("Log of bilateral distance to Syria", size(small)) ytitle("Effects on probability of contributing", size(small)) 


*** Figure 3 ***

* Recall a linear regression result (Model 6 in Table 1)
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)
* Estimate and plot average marginal effects
margins, dydx(L1.ln_syrian_ref) at(ln_distance=(5(0.5)10)) vsquish
marginsplot, yline(0, lpattern(shortdash)) recast(line) recastci(rline) plotopt(lcolor(dknavy)) ciopt(color(gs9) lpattern(dash)) ///
   xlabel(, labsize(small)) ylabel(, labsize(small)) title("AME of logged number of Syrian refugees per 10,000 population (with 95% CIs)", size(medsmall)) ///
   xtitle("Log of bilateral distance to Syria", size(small)) ytitle("Effects on logged contribution amount", size(small))


*** Figure 4 ***

* Recall a linear regression result (Model 6 in Table 1)
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)
* Estimate and plot predictive margins
margins, at(L1.ln_syrian_ref=(0(0.5)3) ln_distance=(7(2)10)) vsquish
marginsplot, plot1opts(lcolor(gs9) lpattern(dash) mcolor(gs9) msymbol(s)) ci1opts(color(gs9)) plot2opts(lcolor(dknavy) mcolor(dknavy) msymbol(d)) ci2opts(color(dknavy)) ///
   xlabel(, labsize(small)) ylabel(, labsize(small)) legend(size(small) lpattern(dash)) title("") ///
   xtitle("Logged number of Syrian refugees per 10,000 population", size(small)) ytitle("Predicted amount of contributions (logged values) with 95% Cls", size(small))


**************************************************************************************************
/* Post-estimation and Robustness Tests (reported in Appendix)                                  */
************************************************************************************************** 


*** Table A5 (Cross-sectional regressions, 1st stage probit) ***

* 2012
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom if year==2012, vce(cluster country)
* 2013 
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom if year==2013, vce(cluster country)
* 2014 
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom if year==2014, vce(cluster country)
* 2015
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom if year==2015, vce(cluster country)
* 2016
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom if year==2016, vce(cluster country)
* 2017
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom if year==2017, vce(cluster country)
* 2018
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom if year==2018, vce(cluster country)
* 2019
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom if year==2019, vce(cluster country)
* 2020
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom if year==2020, vce(cluster country)


*** Table A6 (Cross-sectional regressions, 2nd stage OLS) ***

* 2012
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other if contribute==1 & year==2012, vce(cluster country)
* 2013
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other if contribute==1 & year==2013, vce(cluster country)
* 2014
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other if contribute==1 & year==2014, vce(cluster country)
* 2015
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other if contribute==1 & year==2015, vce(cluster country)
* 2016
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other if contribute==1 & year==2016, vce(cluster country)
* 2017
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other if contribute==1 & year==2017, vce(cluster country)
* 2018
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other if contribute==1 & year==2018, vce(cluster country)
* 2019
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other if contribute==1 & year==2019, vce(cluster country)
* 2020
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other if contribute==1 & year==2020, vce(cluster country)


*** Table A7 (Excluding several potentially influential observations ***

* Excluding Germany
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1 & country!=65, re vce(cluster country)
* Excluding Sweden
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1 & country!=167, re vce(cluster country)
* Excluding Germany and Sweden
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1 & country!=65 & country!=167, re vce(cluster country)
* Excluding Cyprus
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1 & country!=45, re vce(cluster country)
* Excluding Kuwait
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1 & country!=92, re vce(cluster country)
* Excluding Malta
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1 & country!=108, re vce(cluster country)
* Excluding Cyprus, Kuwait, and Malta
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1 & country!=45 & country!=92 & country!=108, re vce(cluster country)


*** Table A8 (Pooled regression and FE models) ***

/* 1st stage */
* Model 1
probit contribute L1.ln_syrian_ref ln_distance ib(2012).year, vce(cluster country)
* Model 2
probit contribute c.L1.ln_syrian_ref##c.ln_distance ib(2012).year, vce(cluster country)
* Model 3
probit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom ib(2012).year, vce(cluster country)

/* 2nd stage */
* Model 4
reg ln_syria_aid L1.ln_syrian_ref ln_distance ib(2012).year if contribute==1, vce(cluster country)
* Model 5
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance ib(2012).year if contribute==1, vce(cluster country)
* Model 6
reg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, vce(cluster country)

/* 2nd stage FE */
* Model 7
xtreg ln_syria_aid L1.ln_syrian_ref ib(2012).year if contribute==1, fe vce(cluster country)
* Model 8
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance ib(2012).year if contribute==1, fe vce(cluster country)
* Model 9
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)


*** Table A9 (Heckman and Double Hurdle models) ***

/* Heckman two-step estimators */
* Model 1-2
heckman ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year, ///
   select(contribute = c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom ib(2012).year) first twostep
* Model 3
heckman ln_syria_aid i.country c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year, ///
   select(contribute = c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom ib(2012).year) first twostep

/* Create lagged varialbes */
generate ln_syrian_ref_lag=L1.ln_syrian_ref
generate ln_gdppc_lag=L1.ln_gdppc
generate ln_export_share_lag=L1.ln_export_share
generate treaties_lag=L1.treaties
generate excom_lag=L1.excom

/* Double Hurdle models */
* Models 4-5
churdle linear ln_syria_aid c.ln_syrian_ref_lag##c.ln_distance ln_gdppc_lag ln_export_share_lag treaties_lag ln_aid_other ib(2012).year, ///
   select(c.ln_syrian_ref_lag##c.ln_distance ln_gdppc_lag ln_export_share_lag treaties_lag ln_aid_other i.excom_lag ib(2012).year) ll(0) vce(cluster country)   
* Model 6
truncreg ln_syria_aid i.country c.ln_syrian_ref_lag##c.ln_distance ln_gdppc_lag ln_export_share_lag treaties_lag ln_aid_other ib(2012).year, ll(0) vce(cluster country)


*** Table A10 (PPML models, 2nd stage) ***

* Model 1
poisson syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year, vce(cluster country)
* Model 2
xtpoisson syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year, re vce(cluster country)
* Model 3
ppmlhdfe syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year, absorb(i.country) vce(cluster country)


*** Table A11 (Two-part models with alternative DV) ***

* Model 1
reg ln_syria_aid_gdp c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, vce(cluster country)
* Model 2
xtreg ln_syria_aid_gdp c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)
* Model 3
xtreg ln_syria_aid_gdp c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)


*** Table A12 (Two-part models with alternative IVs) ***

/* Use absolute values of the number of Syrian refugees and asylum-seekers */
* Model 1
xtprobit contribute c.L1.ln_syrian_ref_abs##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom ib(2012).year, vce(cluster country)
* Model 2
xtreg ln_syria_aid c.L1.ln_syrian_ref_abs##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)

/* Use net inflows of Syrian refugees and asylum-seekers */
* Model 3
xtprobit contribute c.L1.ln_syrian_ref_netflow##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom ib(2012).year, vce(cluster country)
* Model 4
xtreg ln_syria_aid c.L1.ln_syrian_ref_netflow##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)

/* Use the number of asylum applications submitted by Syrians */
* Model 5
xtprobit contribute c.L1.ln_syrian_ref_asylum##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other L1.i.excom ib(2012).year, vce(cluster country)
* Model 6
xtreg ln_syria_aid c.L1.ln_syrian_ref_asylum##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)


*** Table A13 (Two-part models with alternative CVs) ***

/* Use absolute export values */
* Model 1
xtprobit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_value L1.treaties ln_aid_other L1.i.excom ib(2012).year, vce(cluster country)
* Model 2
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_value L1.treaties ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)

/* Use absolute trade values */ 
* Model 3
xtprobit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_trade_value L1.treaties ln_aid_other L1.i.excom ib(2012).year, vce(cluster country)
* Model 4
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_trade_value L1.treaties ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)

/* Use a redefined control variable for the number of ratifications of the relevant treaties made by each state */
* Model 5
xtprobit contribute c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties2 ln_aid_other L1.i.excom ib(2012).year, vce(cluster country)
* Model 6
xtreg ln_syria_aid c.L1.ln_syrian_ref##c.ln_distance L1.ln_gdppc L1.ln_export_share L1.treaties2 ln_aid_other ib(2012).year if contribute==1, re vce(cluster country)


*** Table A14 (Results by donor) ***

/* Ordered by geographicaly proximity to Syria */
* Kuwait 
generate kuwait=1 if country==92
replace kuwait=0 if country!=92
xtreg ln_syria_aid i.kuwait##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Saudi Arabia
generate saudi=1 if country==148
replace saudi=0 if country!=148
xtreg ln_syria_aid i.saudi##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Bulgaria
generate bulgaria=1 if country==26
replace bulgaria=0 if country!=26
xtreg ln_syria_aid i.bulgaria##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Qatar
generate qatar=1 if country==141
replace qatar=0 if country!=141
xtreg ln_syria_aid i.qatar##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Malta
generate malta=1 if country==108
replace malta=0 if country!=108
xtreg ln_syria_aid i.malta##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* United Arab Emirates
generate uae=1 if country==183
replace uae=0 if country!=183
xtreg ln_syria_aid i.uae##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Hungary
generate hungary=1 if country==75
replace hungary=0 if country!=75
xtreg ln_syria_aid i.hungary##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Italy
generate italy=1 if country==83
replace italy=0 if country!=83
xtreg ln_syria_aid i.italy##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Austria
generate austria=1 if country==10
replace austria=0 if country!=10
xtreg ln_syria_aid i.austria##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Poland
generate poland=1 if country==139
replace poland=0 if country!=139
xtreg ln_syria_aid i.poland##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Russian Federation
generate russia=1 if country==143
replace russia=0 if country!=143
xtreg ln_syria_aid i.russia##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Lithuania
generate lithuania=1 if country==101
replace lithuania=0 if country!=101
xtreg ln_syria_aid i.lithuania##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Czech Republic
generate czechia=1 if country==46
replace czechia=0 if country!=46
xtreg ln_syria_aid i.czechia##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Switzerland
generate switzerland=1 if country==168
replace switzerland=0 if country!=168
xtreg ln_syria_aid i.switzerland##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Estonia
generate estonia=1 if country==56
replace estonia=0 if country!=56
xtreg ln_syria_aid i.estonia##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Luxembourg
generate luxembourg=1 if country==102
replace luxembourg=0 if country!=102
xtreg ln_syria_aid i.luxembourg##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Denmark
generate denmark=1 if country==47
replace denmark=0 if country!=47
xtreg ln_syria_aid i.denmark##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Finland
generate finland=1 if country==60
replace finland=0 if country!=60
xtreg ln_syria_aid i.finland##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Germany
generate germany=1 if country==65
replace germany=0 if country!=65
xtreg ln_syria_aid i.germany##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Sweden
generate sweden=1 if country==167
replace sweden=0 if country!=167
xtreg ln_syria_aid i.sweden##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Belgium
generate belgium=1 if country==17
replace belgium=0 if country!=17
xtreg ln_syria_aid i.belgium##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Netherlands
generate netherlands=1 if country==124
replace netherlands=0 if country!=124
xtreg ln_syria_aid i.netherlands##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* France 
generate france=1 if country==61
replace france=0 if country!=61
xtreg ln_syria_aid i.france##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Norway
generate norway=1 if country==130
replace norway=0 if country!=130
xtreg ln_syria_aid i.norway##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* United Kingdom
generate uk=1 if country==184
replace uk=0 if country!=184
xtreg ln_syria_aid i.uk##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Spain
generate spain=1 if country==160
replace spain=0 if country!=160
xtreg ln_syria_aid i.spain##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Ireland
generate ireland=1 if country==81
replace ireland=0 if country!=81
xtreg ln_syria_aid i.ireland##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Iceland
generate iceland=1 if country==76
replace iceland=0 if country!=76
xtreg ln_syria_aid i.iceland##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Korea, Republic of.
generate korea=1 if country==91
replace korea=0 if country!=91
xtreg ln_syria_aid i.korea##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Japan
generate japan=1 if country==85
replace japan=0 if country!=85
xtreg ln_syria_aid i.japan##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* United States
generate usa=1 if country==185
replace usa=0 if country!=185
xtreg ln_syria_aid i.usa##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Canada
generate canada=1 if country==32
replace canada=0 if country!=32
xtreg ln_syria_aid i.canada##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* Australia
generate australia=1 if country==9
replace australia=0 if country!=9
xtreg ln_syria_aid i.australia##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
* New Zealand
generate nz=1 if country==125
replace nz=0 if country!=125
xtreg ln_syria_aid i.nz##c.L1.ln_syrian_ref c.L1.ln_gdppc c.L1.ln_export_share c.L1.treaties c.ln_aid_other ib(2012).year if contribute==1, fe vce(cluster country)
